package fr.babos.test.components 
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Sprite;
	import flash.events.Event;
	import fr.babos.graphic.components.base.StageWrapper;
	import fr.babos.graphic.tools.AdvancedBitmap;
	import fr.babos.graphic.tools.BitmapCache;
	
	/**
	 * ...
	 * @author ...
	 */
	public class AdvancedBitmapTest extends Sprite 
	{
		[Embed(source = "../../../../../lib/graphics/test.jpg")]
		public static const TestImageClass:Class;
		
		protected var _testImage:BitmapData = (new TestImageClass() as Bitmap).bitmapData;
		
		public function AdvancedBitmapTest ()
		{
			if (stage != null)
				init();
			else
				addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		protected function init (event:Event = null):void
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			
			var wrapper:StageWrapper = new StageWrapper(stage);
			
			var advancedBitmap:AdvancedBitmap = new AdvancedBitmap(_testImage, AdvancedBitmap.OUTSIDE_SCALE_MODE);
			
			advancedBitmap.x = 10;
			advancedBitmap.y = 10;
			advancedBitmap.cornerRadius = 100;
			advancedBitmap.outlineSize = 1;
			advancedBitmap.allowOverflow = true;
			
			
			advancedBitmap.place(30, 30, 30, 30).into(wrapper);
		}
	}
}